package com.winit.project.core.branch;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.util.StringUtils;

/**
 * Created by wangjian on 16/9/6.
 */
public abstract class Branch {

    private static final Logger logger = LoggerFactory.getLogger(Branch.class);

    public String projectName;

    public Branch(String projectName) throws Exception{
        if(StringUtils.isEmpty(projectName)){
            logger.error("工程名不能为空");
            throw new Exception("工程名不能为空");
        }
        this.projectName = projectName;
    }

    /**
     * 是否为主干工程
     * @return
     */
    public abstract boolean isTrunk();

    /**
     * 主干工程名
     * @return
     */
    public abstract String getName();

    /**
     * 工程名称后缀 分支标记
     * @return
     */
    public abstract String getSuffix();

    /**
     * 工程全称
     * @return
     */
    public abstract String getFullName();
}
